package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.dto.PageQueryDto;
import com.zzyl.nursing.service.MemberOrdersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * C端订单管理
 * @author: JBY
 * @since: 2025/08/21 20:16
 */
@RestController
@RequestMapping("/member/orders/project")
@Slf4j
@Api(tags = "C端订单管理")
public class MemberOrdersController {

    @Autowired
    private MemberOrdersService memberOrdersService;

    /**
     * 分页查询护理项目列表
     * @param pageQueryDto
     * @return 订单列表
     */
    @GetMapping("/page")
    @ApiOperation("分页查询")
    public TableDataInfo<NursingProject> pageQuery(PageQueryDto pageQueryDto) {
        return memberOrdersService.pageQuery(pageQueryDto);
    }
    /**
     * 获取订单详细信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    @ApiOperation("获取订单详细信息")
    public R getInfo(@ApiParam("订单ID") @PathVariable("id") Long id) {
        return R.ok(memberOrdersService.getById(id));
    }
}
